// ChatServerView.cpp : implementation file
//

#include "stdafx.h"
#include "Chat.h"
#include "ChatServerView.h"
#include "ChatServerDlg.h"
#include "ChildFrm.h"
// CChatServerView

IMPLEMENT_DYNCREATE(CChatServerView, CView)

CChatServerView::CChatServerView()
: m_pChatServerDlg(NULL)
{

}

CChatServerView::~CChatServerView()
{
	if (m_pChatServerDlg)
	{
		delete m_pChatServerDlg;
		m_pChatServerDlg = NULL;
	}
}

BEGIN_MESSAGE_MAP(CChatServerView, CView)
END_MESSAGE_MAP()


// CChatServerView drawing

void CChatServerView::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();
	// TODO: add draw code here
}


// CChatServerView diagnostics

#ifdef _DEBUG
void CChatServerView::AssertValid() const
{
	CView::AssertValid();
}

#ifndef _WIN32_WCE
void CChatServerView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}
#endif
#endif //_DEBUG


// CChatServerView message handlers

void CChatServerView::OnInitialUpdate()
{
	CView::OnInitialUpdate();

	// TODO: Add your specialized code here and/or call the base class
	m_pChatServerDlg = new CChatServerDlg;
	m_pChatServerDlg->SetChatServerDoc(reinterpret_cast<CChatServerDoc&>(*GetDocument()));
	m_pChatServerDlg->SetLogView(*reinterpret_cast<CChildFrame*>(GetParentFrame())->GetLogView());

	m_pChatServerDlg->Create(CChatServerDlg::IDD, this);
	
}
